package com.wxsong.test.nacos.consumer.service.user;

import com.alibaba.fastjson.JSONArray;
import com.wxsong.test.nacos.api.UserApi;
import com.wxsong.test.nacos.model.user.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 描述：
 *
 * @Author songweixing
 * @Date 2020/1/2
 */
@Service
public class UserServiceImpl implements UserService {

    @Resource
    UserApi userApi;

    public JSONArray userList() {
        String userDataStr = userApi.userList();
        JSONArray jsonArray = JSONArray.parseArray(userDataStr);
        return jsonArray;
    }

    public User findUser(String userNo) {
        User user = userApi.findUser(userNo);
        return user;
    }
}
